<?php

/**
 * Upload Model
 *
 * Interacts with the users table in the database.
 *
 * @author David Beard
 * @version 1.0
 * @link https://code.google.com/p/lis3468final/
 */
class Upload_model extends Model {

		/**
		 * Name of Function: Constructor
		 *
		 * Detailed Description: This is my constructor
		 * that automatically loads when this class is instantiated
		 *
		 * @author David
		 */
    function Upload_model()
    {
        parent::Model();

        $this->load->database();
    }


    function Upload_img(){

        $query = $this->db->get_where('users', "`name` = '$username'");

        $this->db->where('username', $this->input->post('username'));
		$this->db->where('password', ($this->input->post('password')));
		$query = $this->db->get('User');

                        $data = array();
			$data['caption'] = $this->input->post('caption');
			$data['img_title'] = $this->input->post('img_title');
			// user ID, Image Vote?

			//Try it...
			$result = $this->db->insert('Image', $data);
			return $result;

    }




}
/*EOF*/
